<?php 

	class User_Model {
		
		public function getUserInfo($user_id) {			
			$res = mysql_query("SELECT username, full_name, email, gender, birth, avatar, about_me, post_count, comment_count 
								FROM user
								WHERE ID='$user_id'
								LIMIT 1");
			return $res;
		}
		
		public function incUserCommentCount($user_id) {
			$ret = mysql_query("UPDATE user
								SET comment_count=comment_count+1
								WHERE ID='$user_id'") or die(mysql_error());
			return $ret;
		}
		
		public function decUserCommentCount($user_id) {
			$ret = mysql_query("UPDATE user
								SET comment_count=comment_count-1
								WHERE ID='$user_id'") or die(mysql_error());
			return $ret;
		}
			
		public function incUserPostCount($user_id) {
			$ret = mysql_query("UPDATE user
								SET post_count=post_count+1
								WHERE ID=$user_id");
			return $ret;
		}			
		
	}


?>